package org.csmzxy233401;

 class Animal1 {
    public void speak(){
        System.out.println("动物发出叫声");
    }
}
class Cat1 extends Animal1{
    @Override
    public void speak(){
        System.out.println("小猫：喵喵……");
    }
}
class Dog1 extends Animal1{
    @Override
    public void speak(){
        System.out.println("小狗：汪汪……");
    }
    public void houseKeep(){
        System.out.println("狗狗会看家");
    }
}
public class example14 {
    public static void main(String[] args){
        Animal1 animal1 = new Dog1();
        animal1.speak();
        Dog1 dog = (Dog1) animal1;
        dog.houseKeep();
    }
}